package com.timk.goserver.client.services;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.timk.goserver.client.model.GameInvite;
import com.timk.goserver.client.model.Message;

/** */
public interface MessageServiceAsync {
	/**
	 * Sends an invite
	 * @param invite the GameInvite
	 * @param callback returns integer error code
	 */
	void sendInvite(GameInvite invite, AsyncCallback callback);
	
	/**
	 * Gets the list of open invites for this user
	 * @param callback returns List&lt;GameInvite&gt;
	 */
	void getInvites(AsyncCallback callback);
	
	/**
	 * Accepts a game invite
	 * @param inviteId
	 * @param callback returns integer error code
	 */
	void acceptInvite(int inviteId, AsyncCallback callback);
	
	/**
	 * Refuses a game invite
	 * @param inviteId
	 * @param callback returns integer error code
	 */
	void refuseInvite(int inviteId, AsyncCallback callback);
	
	/**
	 * Sends a message
	 * @param msg
	 * @param callback returns integer error code
	 */
	void sendMessage(Message msg, AsyncCallback callback);
	
	/**
	 * Retrieves messages for a given user
	 * @param callback returns List&lt;Message&gt;
	 */
	void getMessages(AsyncCallback callback);
	
	/**
	 * Deletes a message
	 * @param messageId the message id
	 * @param callback returns integer error code
	 */
	void deleteMessage(int messageId, AsyncCallback callback);
}
